<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "user_passport".
 *
 * @property string $uid
 * @property string $username
 * @property string $password
 * @property string $user_token
 * @property integer $log_time
 * @property integer $create_time
 */
class UserPassport extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'user_passport';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['uid', 'username', 'password'], 'required'],
            [['log_time', 'create_time'], 'integer'],
            [['uid'], 'string', 'max' => 36],
            [['username'], 'string', 'max' => 20],
            [[ 'password'], 'string', 'max' => 60],
            [['user_token'], 'string', 'max' => 80],
            [['uid', 'password'], 'unique', 'targetAttribute' => ['uid', 'password'], 'message' => 'The combination of Uid and Password has already been taken.']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'uid' => 'Uid',
            'username' => 'Username',
            'password' => 'Password',
            'user_token' => 'User Token',
            'log_time' => 'Log Time',
            'create_time' => 'Create Time',
        ];
    }
}
